package com.vogue.supplymall.example.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.ImportResource;
import org.springframework.web.servlet.config.annotation.CorsRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;

/**
 * Created by Administrator on 2017-11-27.
 */
@Configuration
@ImportResource(locations={"classpath:context.xml"})
public class AppConfig extends WebMvcConfigurerAdapter {

    @Override
    public void addCorsMappings(CorsRegistry registry) {
        registry.addMapping("/**").allowedOrigins("*")
                .allowedMethods("GET", "HEAD", "POST","PUT", "DELETE", "OPTIONS")
                .allowCredentials(false).maxAge(3600);
    }

//    @Bean
//    public JedisConnectionFactory connectionFactory() {
//        JedisConnectionFactory c=new JedisConnectionFactory();
//        c.setHostName("192.168.7.105");
//        c.setPort(6379);
//        return c;
//    }
}
